<template>
  <div>
    <nav class="movie-nav">
      <router-link to="/city" class="one">
        <span class="city-name">{{ a.nm }}</span>
        <i class="city-entry-arrow"></i>
      </router-link>

      <router-link to="/movie">热映</router-link>
      <router-link to="/movie/cinema">影院</router-link>
      <router-link to="/movie/pend">待映</router-link>
      <router-link to="/movie/classic">经典电影</router-link>

      <router-link to="/search" class="last"></router-link>
    </nav>
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  data: function () {
    return {
      a: [],
     
    };
  },
  methods: {
    getHistory() {
      //获取历史记录
      let re = localStorage.getItem("selecthistory");
      this.a = JSON.parse(re)[0];
    },
  },
  created: function () {
    this.getHistory();
    
  },
};
</script>

<style lang="less">
.movie-nav {
  // .switch-hot-default{
  //   position: relative;

  // }

  border-bottom: 0.02rem solid #e6e6e6;
  height: 2.8rem;
  position: fixed;
  top: 110px;
  background-color: #fff;
  z-index: 100;
  .one {
    padding: 15px;
    // margin-left: -30px;
    .city-name {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 1.4rem;
      max-width: 19.2vw;
    }
    .city-entry-arrow {
      width: 0;
      height: 0;
      border: 0.3rem solid transparent;
      border-top-color: #b0b0b0;
      display: inline-block;
      margin-left: 0.2rem;
      margin-right: 1rem;
      margin-top: 1.2rem;
    }
  }
  .last {
    width: 45px;
    height: 40px;
    background: url(../assets/search-red.png) no-repeat;
    background-size: 1.3rem;
    padding: 0.2rem 1.3rem 0.2rem 0.2rem;
    background-position: 0.2rem;
    margin-left: 17px;
  }
  a {
    font-weight: bold;
    color: #666;
    padding: 9px;

    &.router-link-exact-active {
      color: black;
      //    height: 40px;
      // width: 70px;
      border-bottom: 2px solid #dd001b;
    }
  }
}
</style>